<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        function fn(arr = []) {
            let sum = 0
            for (let a = 0; a < arr.length; a++) {
                sum += arr[a]
            }
            alert(sum)
        }
        fn([])



        //函数的返回值
        //return

        //函数返回值联系
        // let b = +prompt('1')
        // let c = +prompt('2')
        // for(let i = 1;i<b;i++){
        //     if(i>b){
        //         i = b
        //     }
        // }

        

    </script>
</body>

</html>